<template>
    <el-dialog
      :title="title"
      :close-on-click-modal="false"
      :visible.sync="visible"
      :before-close="cancel"
      class="JNPF-dialog JNPF-dialog_center"
      lock-scroll
      width="65%"
    >
      <el-row :gutter="20" class="">
        <el-form
          ref="elForm"
          :model="dataForm"
          :rules="rules"
          label-width="120px"
        >
        
        <el-col :span="12">
          <el-form-item label="存放仓库" prop="FSTOCK">
            <el-input v-model="dataForm.FSTOCK"   />
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="存放数量" prop="FNUM">
            <el-input v-model="dataForm.FNUM"   />
          </el-form-item>
        </el-col>

        <el-col :span="12">
          <el-form-item label="危废名称" prop="FCATNAME">
            <el-input v-model="dataForm.FCATNAME"   />
          </el-form-item>
        </el-col>

        
        <el-col :span="12">
          <el-form-item label="存放重量" prop="FWEIGHT">
            <el-input v-model="dataForm.FWEIGHT"   />
          </el-form-item>
        </el-col>


        </el-form>
      </el-row>

      <el-table :data="list" border stripe>
          <el-table-column prop="FBILLNO" label="单号" width="105"></el-table-column>
          <el-table-column prop="FBILLCREDATE" label="过磅日期" width="95"></el-table-column>
          <el-table-column prop="FPOINT" label="来源场地" ></el-table-column>
          <el-table-column prop="FUSER" label="过磅人员" ></el-table-column>
          <el-table-column prop="FCATNO" label="桶固定码" ></el-table-column>
          <el-table-column prop="FWEIGHT" label="过磅重量(kg)" ></el-table-column>
    </el-table>
    
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button  v-if="insertorupdate" type="primary" v-loading="loading">确 定</el-button>
        <el-button v-else type="primary"  v-loading="loading">修 改</el-button>
      </span>
    </el-dialog>
  </template>
  <script>
  import jnpf from "@/utils/jnpf"
  export default {
    props: {
      parelist: {
        type: Array,
        default: []
      },
    },
    data() {
      return {
          checked1:true,
          checked2:true,
          checked3:true,
          checked4:true,
          checked5:true,
          title:"新增",
          dataForm:{
            FWEIGHT:"68.9",
            FNUM:1,
            FCATNO:"851-001-01",
            FCATNAME:"生物实验废物",
            FSTOCK:"生物系仓库",
            FMEMO:"",
            FVISIBLE:"1",
            FOPERATOR: "system",
            FUPDDATE: "2011-02-16T02:57:02.000+00:00"
          },
          rules: {
            FCATNO: [
                  { required: true, message: '请输入危废类别编号', trigger: 'blur' },
              ],
              FCATNAME: [
                  { required: true, message: '请输入行业来源', trigger: 'blur' },
              ],
          },
        fvisiblelist:[
          {id:"1",fullName:"是"},
          {id:"2",fullName:"否"},
        ],

        //所属教学楼选择数据
        options1: [{
          value: '20E01',
          label: '医疗废物'
        }, {
          value: '20E02',
          label: '医药废物'
        }, {
          value: '20N03',
          label: '废有机溶剂与含有机溶剂废物'
        }, {
          value: '20E04',
          label: '多氯（溴）联苯类废物'
        }],

        options2: [{
          value: '1',
          label: '卫生'
        }, {
          value: '2',
          label: '化学药品原药制造'
        }, {
          value: '3',
          label: '生物、生化制品的制造'
        }],

        options3: [{
          value: '1',
          label: '危险废物'
        }, {
          value: '2',
          label: '一般固废'
        }],

        list: [
        {
          "FBILLNO":"20240901001",
          "FBILLCREDATE":"2024-09-01",
          "FPOINT":"奉综教楼201",
          "FUSER":"曹操",
          "FCATNO":"Z24080100028",
          "FWEIGHT":45.0,
          "FMEMO":"",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FBILLNO":"20240902002",
          "FBILLCREDATE":"2024-09-02",
          "FPOINT":"奉综教楼202",
          "FUSER":"吕布",
          "FCATNO":"Z24062100098",
          "FWEIGHT":15.0,
          "FMEMO":"",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FBILLNO":"20240903008",
          "FBILLCREDATE":"2024-09-03",
          "FPOINT":"奉综教楼202",
          "FUSER":"董卓",
          "FCATNO":"Z24053200878",
          "FWEIGHT":45.0,
          "FMEMO":"",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FBILLNO":"20240901009",
          "FBILLCREDATE":"2024-09-05",
          "FPOINT":"奉综教楼503",
          "FUSER":"刘备",
          "FCATNO":"Z24082300348",
          "FWEIGHT":49.2,
          "FMEMO":"",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FBILLNO":"20240901001",
          "FBILLCREDATE":"2024-09-10",
          "FPOINT":"奉综教楼503",
          "FUSER":"张飞",
          "FCATNO":"Z24032300068",
          "FWEIGHT":35.8,
          "FMEMO":"",
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],

        loading:false,
        visible:false,
        insertorupdate:true
      };
    },
    created() {
    },
    mounted() {},
    methods: {
      //
      init(id){
        this.dataForm.FCATNO= id || ''
          if(this.dataForm.FCATNO)
          {
              this.title="修改"
             this.insertorupdate=false;
          }
          else
          {
            this.insertorupdate=true;
              this.title="新增";
          }
          this.visible=true;
      },
      //
      cancel(){
          this.$refs.elForm.resetFields();
          this.visible=false;
      },
    },
  };
  </script>
  
  
  
  
  